import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.repository.ProcessDefinition;
import org.junit.Test;

import java.util.List;

public class deploy {

    @Test
    public void test(){
        ProcessEngine defaultProcessEngine = ProcessEngines.getDefaultProcessEngine();
        List<ProcessDefinition> list = defaultProcessEngine.getRepositoryService().createProcessDefinitionQuery()
                .processDefinitionKey("bus_leave").list();
        for (ProcessDefinition definition : list) {
            String deploymentId = definition.getDeploymentId();
            defaultProcessEngine.getRepositoryService().deleteDeployment(deploymentId,true);
        }

    }
}
